<?php

class Intro extends Controller {
	private $do = 'content';
	private $msg;
	
	function Intro() {
		parent::Controller ();
		$this->lang->load( 'admin', 'vietnamese' );
		$this->load->helper( 'admin_helper' );
		$this->load->helper( 'link_helper' );
		
		$this->load->model('admin/intro_model');
		
		check_login();
	}
	
	function index() {
		
		if ( isset( $_POST['submit']  )) {
			$this->intro_model->update_intros();
			$this->msg[] = 'Thay đổi cấu hình thành công';	
		}
		
		$row = $this->intro_model->select_intros();
		
		if ( $row ) {
			$data = array(
				'title'		=> 'Giới thiệu',
				'do'		=> $this->do,	
				'msg'		=> $this->msg,
				'row'		=> $row
			);
					
			$this->load->view ( ADMINPATH . 'admin_header', $data );
			$this->load->view ( ADMINPATH . 'intro_web', $data );
			$this->load->view ( ADMINPATH . 'admin_footer', $data );
		}
	}
}
